#include "stdafx.h"
#include "wf_filesave.h"

#include "pf_graphic.h"



WF_FileSave::WF_FileSave(PF_Container& container,
                                     PF_GraphicView& graphicView)
        :PF_ActionInterface("File Save", container, graphicView) {}


QAction* WF_FileSave::createGUIAction(LX_Define::ActionType /*type*/, QObject* parent) {
	
	//(tr("Save Drawing")
	QAction* action = new QAction(tr("&Save"), parent);
#if QT_VERSION >= 0x040600
        action->setIcon(QIcon::fromTheme("document-save", QIcon(":/actions/filesave2.png")));
#else
        action->setIcon(QIcon(":/actions/filesave2.png"));
#endif
        action->setShortcut(QKeySequence::Save);
    //action->zetStatusTip(tr("Saves the current drawing"));
	
    return action;
}


void WF_FileSave::trigger() {
    PF_DEBUG->print("PF_ActionFileSave::trigger");

    if (graphic!=NULL) {
        graphic->save();
    }
    finish();
}



void WF_FileSave::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
}

// EOF
